package com.travel.feign;

import com.travel.pojo.CarPackage;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("es-service")
@RequestMapping("/CarSearch")
public interface CarSearchFeign {
//    @GetMapping("/search")
    @RequestMapping("/search")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "keyword", value = "关键字", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "pageNumber", value = "页码", required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "pageSize", value = "每页大小", required = false, dataType = "int", paramType = "query")
    })
    List<CarPackage> search(@RequestParam(value = "keyword") String keyword,
                            @RequestParam(value = "pageNumber",defaultValue = "0") int pageNumber,
                            @RequestParam(value = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("/hotelSearch/estest")
    String estest();
}
